import org.molamil.acto.mc.mcw.McDelegate;

/**
 * <code>LcMcWrapper</code> that associates states with labels.
 * The MC has to have 4 labels in the timeline, when the state changes, the MC is played
 * from the corresponding label:
 * <ul>
 * 	<li><code>in</code>: Corresponding state <code>"IN"</code> - the MC starts being 
 *  built, animated in.</li>
 * 	<li><code>on</code>: Corresponding state <code>"ON"</code> - the MC has been built, 
 *  default state when stand by.</li>
 * 	<li><code>out</code>: Corresponding state <code>"OUT"</code> - the MC starts being 
 *  unbuilt, animated out.</li>
 * 	<li><code>off</code>: Corresponding state <code>"OFF"</code> - the MC has been 
 *  unbuilt.</li>
 * </ul>
 *
 * @author Jorge Hernandez
 */
class org.molamil.acto.mc.mcw.Labeled extends McDelegate {
	
	
	// Constants
	
	/**
	 * Corresponding state <code>"IN"</code> - the MC starts being built, animated in.
	 * With value <code>IN</code>
	 */
	public static function get LABEL_IN():String { return "IN"; }
	
	/**
	 * Corresponding state <code>"ON"</code> - the MC has been built, default state when stand by.
	 * With value <code>ON</code>
	 */
	public static function get LABEL_ON():String { return "ON"; }
	
	/**
	 * Corresponding state <code>"OUT"</code> - the MC starts being unbuilt, animated out.
	 * With value <code>OUT</code>
	 */
	public static function get LABEL_OUT():String { return "OUT"; }
	
	/**
	 * Corresponding state <code>"OFF"</code> - the MC has been unbuilt.
	 * With value <code>OFF</code>
	 */
	public static function get LABEL_OFF():String { return "OFF"; }
	
	
	// Functions
	
	private function changeState():Void {
		super.changeState();
		if (state == STATE_IN) {
			mc.gotoAndPlay(LABEL_IN);
		} else if (state == STATE_ON) {
			mc.gotoAndStop(LABEL_ON);
		} else if (state == STATE_OUT) {
			mc.gotoAndPlay(LABEL_OUT);
		} else if (state == STATE_OFF) {
			mc.gotoAndStop(LABEL_OFF);
		}
	}
	
	
}